<!DOCTYPE html>
<html lang="" xml:lang="">
<head>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title>第 12 章 大话 PCA | 使用 R 语言分析 LI-6400 和 LI-6800 光合仪的数据</title>
  <meta name="description" content="使用 R 语言分析 LI-6400XT 与 LI-6800 数据" />
  <meta name="generator" content="bookdown 0.24 and GitBook 2.6.7" />

  <meta property="og:title" content="第 12 章 大话 PCA | 使用 R 语言分析 LI-6400 和 LI-6800 光合仪的数据" />
  <meta property="og:type" content="book" />
  
  <meta property="og:image" content="/images/coverpage.png" />
  <meta property="og:description" content="使用 R 语言分析 LI-6400XT 与 LI-6800 数据" />
  <meta name="github-repo" content="zhujiedong/photoanalysis" />

  <meta name="twitter:card" content="summary" />
  <meta name="twitter:title" content="第 12 章 大话 PCA | 使用 R 语言分析 LI-6400 和 LI-6800 光合仪的数据" />
  
  <meta name="twitter:description" content="使用 R 语言分析 LI-6400XT 与 LI-6800 数据" />
  <meta name="twitter:image" content="/images/coverpage.png" />

<meta name="author" content="祝介东    北京力高泰科技有限公司" />


<meta name="date" content="2021-11-12" />

  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  
  
<link rel="prev" href="big-leaf.html"/>
<link rel="next" href="sessioninfo.html"/>
<script src="libs/header-attrs-2.11/header-attrs.js"></script>
<script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.4.6/dist/fuse.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-table.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-clipboard.css" rel="stylesheet" />








<link href="libs/anchor-sections-1.0.1/anchor-sections.css" rel="stylesheet" />
<script src="libs/anchor-sections-1.0.1/anchor-sections.js"></script>


<style type="text/css">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
  { counter-reset: source-line 0; }
pre.numberSource code > span
  { position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
  { content: counter(source-line);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
    color: #aaaaaa;
  }
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
div.sourceCode
  {   }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>

<style type="text/css">
/* Used with Pandoc 2.11+ new --citeproc when CSL is used */
div.csl-bib-body { }
div.csl-entry {
  clear: both;
}
.hanging div.csl-entry {
  margin-left:2em;
  text-indent:-2em;
}
div.csl-left-margin {
  min-width:2em;
  float:left;
}
div.csl-right-inline {
  margin-left:2em;
  padding-left:1em;
}
div.csl-indent {
  margin-left: 2em;
}
</style>

<link rel="stylesheet" href="css/style.css" type="text/css" />
</head>

<body>



  <div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">

    <div class="book-summary">
      <nav role="navigation">

<ul class="summary">
<li><a href="./">R 软件与光合数据分析</a></li>

<li class="divider"></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>欢迎</a></li>
<li class="chapter" data-level="" data-path="frontmatter.html"><a href="frontmatter.html"><i class="fa fa-check"></i>前言</a></li>
<li class="chapter" data-level="" data-path="copyright.html"><a href="copyright.html"><i class="fa fa-check"></i>版权</a></li>
<li class="chapter" data-level="1" data-path="intro.html"><a href="intro.html"><i class="fa fa-check"></i><b>1</b> R 软件与 Rstudio</a>
<ul>
<li class="chapter" data-level="1.1" data-path="intro.html"><a href="intro.html#rsoft"><i class="fa fa-check"></i><b>1.1</b> R 软件</a></li>
<li class="chapter" data-level="1.2" data-path="intro.html"><a href="intro.html#rstudiosoft"><i class="fa fa-check"></i><b>1.2</b> Rstudio</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="batch_question.html"><a href="batch_question.html"><i class="fa fa-check"></i><b>2</b> 批量处理光合测定数据</a>
<ul>
<li class="chapter" data-level="2.1" data-path="batch_question.html"><a href="batch_question.html#install_readphoto"><i class="fa fa-check"></i><b>2.1</b> 安装</a></li>
<li class="chapter" data-level="2.2" data-path="batch_question.html"><a href="batch_question.html#batch64"><i class="fa fa-check"></i><b>2.2</b> LI-6400 数据处理</a>
<ul>
<li class="chapter" data-level="2.2.1" data-path="batch_question.html"><a href="batch_question.html#li-6400-数据的整合6400combine"><i class="fa fa-check"></i><b>2.2.1</b> LI-6400 数据的整合{#6400combine}</a></li>
<li class="chapter" data-level="2.2.2" data-path="batch_question.html"><a href="batch_question.html#recompute6400"><i class="fa fa-check"></i><b>2.2.2</b> LI-6400 数据重计算</a></li>
</ul></li>
<li class="chapter" data-level="2.3" data-path="batch_question.html"><a href="batch_question.html#li-6800-数据的处理-6800data"><i class="fa fa-check"></i><b>2.3</b> LI-6800 数据的处理 {#6800data}</a>
<ul>
<li class="chapter" data-level="2.3.1" data-path="batch_question.html"><a href="batch_question.html#r-下-excel-格式读取的重计算-6800xlconnect"><i class="fa fa-check"></i><b>2.3.1</b> R 下 Excel 格式读取的重计算 {##6800xlconnect}</a></li>
<li class="chapter" data-level="2.3.2" data-path="batch_question.html"><a href="batch_question.html#python"><i class="fa fa-check"></i><b>2.3.2</b> 使用 Python 来处理</a></li>
<li class="chapter" data-level="2.3.3" data-path="batch_question.html"><a href="batch_question.html#python-r-batch"><i class="fa fa-check"></i><b>2.3.3</b> 批量处理 csv 文件</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="response_fit.html"><a href="response_fit.html"><i class="fa fa-check"></i><b>3</b> CO<sub>2</sub> 响应曲线的拟合</a>
<ul>
<li class="chapter" data-level="3.1" data-path="response_fit.html"><a href="response_fit.html#fvcb_mod"><i class="fa fa-check"></i><b>3.1</b> FvCB 模型</a></li>
<li class="chapter" data-level="3.2" data-path="response_fit.html"><a href="response_fit.html#co2_note"><i class="fa fa-check"></i><b>3.2</b> CO<sub>2</sub> 响应曲线测量的注意事项</a>
<ul>
<li class="chapter" data-level="3.2.1" data-path="response_fit.html"><a href="response_fit.html#model_3"><i class="fa fa-check"></i><b>3.2.1</b> 分段性</a></li>
<li class="chapter" data-level="3.2.2" data-path="response_fit.html"><a href="response_fit.html#note_detail"><i class="fa fa-check"></i><b>3.2.2</b> 测量注意事项</a></li>
</ul></li>
<li class="chapter" data-level="3.3" data-path="response_fit.html"><a href="response_fit.html#plantecophys"><i class="fa fa-check"></i><b>3.3</b> <code>plantecophys</code> 软件包</a></li>
<li class="chapter" data-level="3.4" data-path="response_fit.html"><a href="response_fit.html#fit6400"><i class="fa fa-check"></i><b>3.4</b> LI-6400XT CO<sub>2</sub> 响应曲线的拟合</a>
<ul>
<li class="chapter" data-level="3.4.1" data-path="response_fit.html"><a href="response_fit.html#fitaci_intro"><i class="fa fa-check"></i><b>3.4.1</b> fitaci 函数介绍</a></li>
</ul></li>
<li class="chapter" data-level="3.5" data-path="response_fit.html"><a href="response_fit.html#plantecophy_use"><i class="fa fa-check"></i><b>3.5</b> 使用 <code>plantecophys</code> 拟合 LI-6400XT CO<sub>2</sub> 响应曲线数据</a>
<ul>
<li class="chapter" data-level="3.5.1" data-path="response_fit.html"><a href="response_fit.html#data6400"><i class="fa fa-check"></i><b>3.5.1</b> 数据的前处理</a></li>
<li class="chapter" data-level="3.5.2" data-path="response_fit.html"><a href="response_fit.html#fitaci-p"><i class="fa fa-check"></i><b>3.5.2</b> 使用示例</a></li>
<li class="chapter" data-level="3.5.3" data-path="response_fit.html"><a href="response_fit.html#onpoint_fit"><i class="fa fa-check"></i><b>3.5.3</b> 使用 ‘onepoint’ 单独计算 V<sub>cmax</sub> 和 J<sub>max</sub></a></li>
<li class="chapter" data-level="3.5.4" data-path="response_fit.html"><a href="response_fit.html#multi_curve"><i class="fa fa-check"></i><b>3.5.4</b> 多条 CO<sub>2</sub> 响应曲线的拟合</a></li>
<li class="chapter" data-level="3.5.5" data-path="response_fit.html"><a href="response_fit.html#transition"><i class="fa fa-check"></i><b>3.5.5</b> <code>findCiTransition</code> 函数</a></li>
</ul></li>
<li class="chapter" data-level="3.6" data-path="response_fit.html"><a href="response_fit.html#c4"><i class="fa fa-check"></i><b>3.6</b> C4 植物光合</a>
<ul>
<li class="chapter" data-level="3.6.1" data-path="response_fit.html"><a href="response_fit.html#c4_sim"><i class="fa fa-check"></i><b>3.6.1</b> C4 植物光合速率的计算</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="4" data-path="stomotal_sim.html"><a href="stomotal_sim.html"><i class="fa fa-check"></i><b>4</b> 气孔导度模型的拟合</a>
<ul>
<li class="chapter" data-level="4.1" data-path="stomotal_sim.html"><a href="stomotal_sim.html#ballberry"><i class="fa fa-check"></i><b>4.1</b> BallBerry 模型</a></li>
<li class="chapter" data-level="4.2" data-path="stomotal_sim.html"><a href="stomotal_sim.html#bbleuning"><i class="fa fa-check"></i><b>4.2</b> BBLeuning 模型</a></li>
<li class="chapter" data-level="4.3" data-path="stomotal_sim.html"><a href="stomotal_sim.html#bboptifull"><i class="fa fa-check"></i><b>4.3</b> BBOptiFull 模型</a></li>
<li class="chapter" data-level="4.4" data-path="stomotal_sim.html"><a href="stomotal_sim.html#fitbb-p"><i class="fa fa-check"></i><b>4.4</b> <code>fitBB</code> 函数</a></li>
<li class="chapter" data-level="4.5" data-path="stomotal_sim.html"><a href="stomotal_sim.html#fitbbs"><i class="fa fa-check"></i><b>4.5</b> <code>fitBBs</code> 函数</a></li>
</ul></li>
<li class="chapter" data-level="5" data-path="stomotal_couple.html"><a href="stomotal_couple.html"><i class="fa fa-check"></i><b>5</b> 光合最优气孔导度耦合模型</a>
<ul>
<li class="chapter" data-level="5.1" data-path="stomotal_couple.html"><a href="stomotal_couple.html#farao"><i class="fa fa-check"></i><b>5.1</b> <code>FARAO</code> 函数</a></li>
</ul></li>
<li class="chapter" data-level="6" data-path="photo_stomo.html"><a href="photo_stomo.html"><i class="fa fa-check"></i><b>6</b> 光合气孔导度耦合模型</a>
<ul>
<li class="chapter" data-level="6.1" data-path="photo_stomo.html"><a href="photo_stomo.html#photosyn"><i class="fa fa-check"></i><b>6.1</b> <code>Photosyn</code> 函数</a>
<ul>
<li class="chapter" data-level="6.1.1" data-path="photo_stomo.html"><a href="photo_stomo.html#photo_exam"><i class="fa fa-check"></i><b>6.1.1</b> <code>Photosyn</code> 使用举例</a></li>
</ul></li>
<li class="chapter" data-level="6.2" data-path="photo_stomo.html"><a href="photo_stomo.html#photsyneb"><i class="fa fa-check"></i><b>6.2</b> <code>PhotosynEB</code> 函数</a></li>
<li class="chapter" data-level="6.3" data-path="photo_stomo.html"><a href="photo_stomo.html#photosyntuzet"><i class="fa fa-check"></i><b>6.3</b> <code>PhotosynTuzet</code> 函数</a>
<ul>
<li class="chapter" data-level="6.3.1" data-path="photo_stomo.html"><a href="photo_stomo.html#photosyntuzet_para"><i class="fa fa-check"></i><b>6.3.1</b> <code>PhotosynTuzet</code> 的参数</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="7" data-path="rhtovpd.html"><a href="rhtovpd.html"><i class="fa fa-check"></i><b>7</b> RHtoVPD 函数</a></li>
<li class="chapter" data-level="8" data-path="lrc_fit.html"><a href="lrc_fit.html"><i class="fa fa-check"></i><b>8</b> 光响应曲线的拟合</a>
<ul>
<li class="chapter" data-level="8.1" data-path="lrc_fit.html"><a href="lrc_fit.html#rec_mod"><i class="fa fa-check"></i><b>8.1</b> 直角双曲线模型</a>
<ul>
<li class="chapter" data-level="8.1.1" data-path="lrc_fit.html"><a href="lrc_fit.html#rec_fit"><i class="fa fa-check"></i><b>8.1.1</b> 直角双曲线模型的实现</a></li>
</ul></li>
<li class="chapter" data-level="8.2" data-path="lrc_fit.html"><a href="lrc_fit.html#nonrec-mod"><i class="fa fa-check"></i><b>8.2</b> 非直角双曲线模型</a>
<ul>
<li class="chapter" data-level="8.2.1" data-path="lrc_fit.html"><a href="lrc_fit.html#nonrec_mode_exam"><i class="fa fa-check"></i><b>8.2.1</b> 非直角双曲线模型的实现</a></li>
</ul></li>
<li class="chapter" data-level="8.3" data-path="lrc_fit.html"><a href="lrc_fit.html#lrc_exp"><i class="fa fa-check"></i><b>8.3</b> 指数模型</a>
<ul>
<li class="chapter" data-level="8.3.1" data-path="lrc_fit.html"><a href="lrc_fit.html#lrc_exp_exam"><i class="fa fa-check"></i><b>8.3.1</b> 指数模型的实现</a></li>
</ul></li>
<li class="chapter" data-level="8.4" data-path="lrc_fit.html"><a href="lrc_fit.html#rev_rec"><i class="fa fa-check"></i><b>8.4</b> 直角双曲线的修正模型</a>
<ul>
<li class="chapter" data-level="8.4.1" data-path="lrc_fit.html"><a href="lrc_fit.html#rev_rec_exam"><i class="fa fa-check"></i><b>8.4.1</b> 直角双曲线修正模型的实现</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="9" data-path="start_con.html"><a href="start_con.html"><i class="fa fa-check"></i><b>9</b> 关于非线性拟合的初始值</a>
<ul>
<li class="chapter" data-level="9.1" data-path="start_con.html"><a href="start_con.html#nlslm"><i class="fa fa-check"></i><b>9.1</b> nlsLM 解决方案</a></li>
<li class="chapter" data-level="9.2" data-path="start_con.html"><a href="start_con.html#plot_comp"><i class="fa fa-check"></i><b>9.2</b> 作图比对法</a>
<ul>
<li class="chapter" data-level="9.2.1" data-path="start_con.html"><a href="start_con.html#plot_exam"><i class="fa fa-check"></i><b>9.2.1</b> 实现过程</a></li>
<li class="chapter" data-level="9.2.2" data-path="start_con.html"><a href="start_con.html#show_demo"><i class="fa fa-check"></i><b>9.2.2</b> 直观展示</a></li>
</ul></li>
<li class="chapter" data-level="9.3" data-path="start_con.html"><a href="start_con.html#mult_try"><i class="fa fa-check"></i><b>9.3</b> 自动多次尝试法</a></li>
<li class="chapter" data-level="9.4" data-path="start_con.html"><a href="start_con.html#sum_start"><i class="fa fa-check"></i><b>9.4</b> 小结</a></li>
</ul></li>
<li class="chapter" data-level="10" data-path="anay_6800.html"><a href="anay_6800.html"><i class="fa fa-check"></i><b>10</b> LI-6800 的数据分析</a>
<ul>
<li class="chapter" data-level="10.1" data-path="anay_6800.html"><a href="anay_6800.html#data6800"><i class="fa fa-check"></i><b>10.1</b> 数据格式</a></li>
<li class="chapter" data-level="10.2" data-path="anay_6800.html"><a href="anay_6800.html#dif"><i class="fa fa-check"></i><b>10.2</b> LI-6800 与 LI-6400 使用时的差别</a></li>
<li class="chapter" data-level="10.3" data-path="anay_6800.html"><a href="anay_6800.html#notice"><i class="fa fa-check"></i><b>10.3</b> 光响应曲线注意事项</a></li>
<li class="chapter" data-level="10.4" data-path="anay_6800.html"><a href="anay_6800.html#other_light_response"><i class="fa fa-check"></i><b>10.4</b> 其他软件包的光响应曲线</a></li>
<li class="chapter" data-level="10.5" data-path="anay_6800.html"><a href="anay_6800.html#racir68"><i class="fa fa-check"></i><b>10.5</b> LI-6800 RACiR的测量与拟合</a></li>
<li class="chapter" data-level="10.6" data-path="anay_6800.html"><a href="anay_6800.html#racir-conifer"><i class="fa fa-check"></i><b>10.6</b> LI-6800 RACiR簇状叶的测量与拟合</a></li>
<li class="chapter" data-level="10.7" data-path="anay_6800.html"><a href="anay_6800.html#multi1"><i class="fa fa-check"></i><b>10.7</b> 多个速率的 RACiR 曲线研究</a>
<ul>
<li class="chapter" data-level="10.7.1" data-path="anay_6800.html"><a href="anay_6800.html#multi2"><i class="fa fa-check"></i><b>10.7.1</b> 光呼吸滞后模型</a></li>
<li class="chapter" data-level="10.7.2" data-path="anay_6800.html"><a href="anay_6800.html#code-photoresp"><i class="fa fa-check"></i><b>10.7.2</b> 光呼吸滞后性代码</a></li>
<li class="chapter" data-level="10.7.3" data-path="anay_6800.html"><a href="anay_6800.html#multi4"><i class="fa fa-check"></i><b>10.7.3</b> 数据的构造</a></li>
<li class="chapter" data-level="10.7.4" data-path="anay_6800.html"><a href="anay_6800.html#multi5"><i class="fa fa-check"></i><b>10.7.4</b> 光呼吸滞后性作图</a></li>
<li class="chapter" data-level="10.7.5" data-path="anay_6800.html"><a href="anay_6800.html#multi6"><i class="fa fa-check"></i><b>10.7.5</b> 补偿点计算</a></li>
<li class="chapter" data-level="10.7.6" data-path="anay_6800.html"><a href="anay_6800.html#multi7"><i class="fa fa-check"></i><b>10.7.6</b> 无光呼吸酶失活模块</a></li>
<li class="chapter" data-level="10.7.7" data-path="anay_6800.html"><a href="anay_6800.html#multi9"><i class="fa fa-check"></i><b>10.7.7</b> 酶失活作图</a></li>
<li class="chapter" data-level="10.7.8" data-path="anay_6800.html"><a href="anay_6800.html#multi10"><i class="fa fa-check"></i><b>10.7.8</b> 不同失活程度下补偿点计算</a></li>
</ul></li>
<li class="chapter" data-level="10.8" data-path="anay_6800.html"><a href="anay_6800.html#multi11"><i class="fa fa-check"></i><b>10.8</b> 时间延迟的扩散限制</a>
<ul>
<li class="chapter" data-level="10.8.1" data-path="anay_6800.html"><a href="anay_6800.html#multi12"><i class="fa fa-check"></i><b>10.8.1</b> 扩散限制滞后性</a></li>
</ul></li>
<li class="chapter" data-level="10.9" data-path="anay_6800.html"><a href="anay_6800.html#multi13"><i class="fa fa-check"></i><b>10.9</b> 扩散限制作图</a>
<ul>
<li class="chapter" data-level="10.9.1" data-path="anay_6800.html"><a href="anay_6800.html#multi14"><i class="fa fa-check"></i><b>10.9.1</b> 补偿点的计算</a></li>
<li class="chapter" data-level="10.9.2" data-path="anay_6800.html"><a href="anay_6800.html#multi15"><i class="fa fa-check"></i><b>10.9.2</b> 所有图形代码</a></li>
</ul></li>
<li class="chapter" data-level="10.10" data-path="anay_6800.html"><a href="anay_6800.html#fluro68"><i class="fa fa-check"></i><b>10.10</b> LI-6800 荧光数据分析</a>
<ul>
<li class="chapter" data-level="10.10.1" data-path="anay_6800.html"><a href="anay_6800.html#jiptest"><i class="fa fa-check"></i><b>10.10.1</b> jip test 的实现</a></li>
<li class="chapter" data-level="10.10.2" data-path="anay_6800.html"><a href="anay_6800.html#jiptest_pack"><i class="fa fa-check"></i><b>10.10.2</b> <code>jiptest</code> 软件包安装</a></li>
<li class="chapter" data-level="10.10.3" data-path="anay_6800.html"><a href="anay_6800.html#readfluor"><i class="fa fa-check"></i><b>10.10.3</b> <code>read_files</code> 及 <code>read_dcfiles</code> 函数</a></li>
<li class="chapter" data-level="10.10.4" data-path="anay_6800.html"><a href="anay_6800.html#testfluor"><i class="fa fa-check"></i><b>10.10.4</b> <code>jip_test</code> 及 <code>jip_dctest</code> 函数</a></li>
<li class="chapter" data-level="10.10.5" data-path="anay_6800.html"><a href="anay_6800.html#plotfluor"><i class="fa fa-check"></i><b>10.10.5</b> 图像查看函数</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="11" data-path="big-leaf.html"><a href="big-leaf.html"><i class="fa fa-check"></i><b>11</b> 大叶模型</a>
<ul>
<li class="chapter" data-level="11.1" data-path="big-leaf.html"><a href="big-leaf.html#leaf-scale-meas"><i class="fa fa-check"></i><b>11.1</b> 叶片尺度测量</a></li>
<li class="chapter" data-level="11.2" data-path="big-leaf.html"><a href="big-leaf.html#big-leaf-data"><i class="fa fa-check"></i><b>11.2</b> 数据的处理</a>
<ul>
<li class="chapter" data-level="11.2.1" data-path="big-leaf.html"><a href="big-leaf.html#single-data-big-leaf"><i class="fa fa-check"></i><b>11.2.1</b> 单个测量数据的处理</a></li>
<li class="chapter" data-level="11.2.2" data-path="big-leaf.html"><a href="big-leaf.html#big-leaf-data-MODEL"><i class="fa fa-check"></i><b>11.2.2</b> 大叶模型的数据处理</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="12" data-path="pca-anylysis.html"><a href="pca-anylysis.html"><i class="fa fa-check"></i><b>12</b> 大话 PCA</a>
<ul>
<li class="chapter" data-level="12.1" data-path="pca-anylysis.html"><a href="pca-anylysis.html#geom-pca"><i class="fa fa-check"></i><b>12.1</b> 几何解释</a></li>
<li class="chapter" data-level="12.2" data-path="pca-anylysis.html"><a href="pca-anylysis.html#alge-pca"><i class="fa fa-check"></i><b>12.2</b> 线性代数解释</a>
<ul>
<li class="chapter" data-level="12.2.1" data-path="pca-anylysis.html"><a href="pca-anylysis.html#egi-pca"><i class="fa fa-check"></i><b>12.2.1</b> 特征向量与特征值</a></li>
<li class="chapter" data-level="12.2.2" data-path="pca-anylysis.html"><a href="pca-anylysis.html#man_pca"><i class="fa fa-check"></i><b>12.2.2</b> 手动实现过程</a></li>
<li class="chapter" data-level="12.2.3" data-path="pca-anylysis.html"><a href="pca-anylysis.html#prcom"><i class="fa fa-check"></i><b>12.2.3</b> <code>prcomp</code> 的实现</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="13" data-path="sessioninfo.html"><a href="sessioninfo.html"><i class="fa fa-check"></i><b>13</b> 环境与配置</a></li>
<li class="chapter" data-level="" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i>参考文献</a></li>
<li class="divider"></li>
<li><a href="https://bookdown.org" target="blank">由 bookdown 驱动</a></li>

</ul>

      </nav>
    </div>

    <div class="book-body">
      <div class="body-inner">
        <div class="book-header" role="navigation">
          <h1>
            <i class="fa fa-circle-o-notch fa-spin"></i><a href="./">使用 R 语言分析 LI-6400 和 LI-6800 光合仪的数据</a>
          </h1>
        </div>

        <div class="page-wrapper" tabindex="-1" role="main">
          <div class="page-inner">

            <section class="normal" id="section-">
<div id="pca-anylysis" class="section level1" number="12">
<h1><span class="header-section-number">第 12 章</span> 大话 PCA</h1>
<p>PCA 作为一个基础的方法，应用领域覆盖很广，涵盖的统计学相关的内容有均值、标准差、协方差， 线性代数中的特征向量及特征值。当然在与光合仪相关的应用方面多数是测量的光合速率、气孔导度等配合植物的其他性状来进行研究，其适用范围，用现在流行的统计学习术语来讲，应属于非监督性学习，即我们并非预测某变量同其预测值的关系，如同我们获得了一系列包含植物光合性状在内的性状，但我们并非将其预测某些结果，如同响应曲线那般，而是用这些形状来分类或者看齐对某目的的重要程度。本章的标题之所以叫大话，是因为这是我结合我自己的理解写的内容，如有错误请谅解，请指出。</p>
<p>另，推荐两个我认为很好的解释 PCA 的链接：</p>
<p><a href="https://blog.bioturing.com/2018/06/14/principal-component-analysis-explained-simply/">BioTuring’s Blog</a></p>
<p><a href="http://setosa.io/ev/principal-component-analysis/">Principal Component Analysis</a></p>
<div id="geom-pca" class="section level2" number="12.1">
<h2><span class="header-section-number">12.1</span> 几何解释</h2>
<p>PCA 通常能够反映我们复杂数据集的一些分布特征，例如典型的 <code>iris</code> 数据集，我们看到了三个鸢尾种的四个性状：花萼的长宽、花瓣的长宽，如果给我们这么一个数据，我们肉眼很难看出他们的特征来，如果作图也很难表达，因为这是一个四维的数据，假设我们只对前两组也就是花萼的长宽作图，先看一下二维的数据情况：</p>
<p><img src="bookdown_files/figure-html/2dim-1.png" width="672" /></p>
<p>看上去一言难尽，此时的缺点非常明显，图中的每个点均代表了某个植株的两个性状，这个性状类似于我们说的电子云，杂乱而无规律。这还只是二维数据，如果我们将所有四个轴的数据都显示也就是四维的数据，那么对于我等肉眼凡胎来讲，还是不看为妙。</p>
<p>我在看到上面留的两个网址之前，对主成份分析的疑惑一直没断过，什么是主成份，一直说是主轴旋转，到底是怎么旋转的，我们看一下主成份的 PC1 是怎么来做的:</p>
<div class="figure"><span style="display:block;" id="fig:pccenter"></span>
<img src="images/pc1.png" alt="数据的中心化" width="100%" />
<p class="caption">
图 12.1: 数据的中心化
</p>
</div>
<p>如图 <a href="pca-anylysis.html#fig:pccenter">12.1</a>，假设有三维的数据，可以理解为 iris 数据中前三列的观测值，每个点分别代表了一个植株的前三个性状，PCA 第一步便是中心化，将坐标轴由左边转移到右边的中心点位置作为原点，这就是所谓的平均值中心化的过程，这样就消除了测量时的偏差 <a href="references.html#fn15" class="footnote-ref" id="fnref15"><sup>15</sup></a>，同时一般还要对数据进行缩放，以消除不同单位的影响 <a href="references.html#fn16" class="footnote-ref" id="fnref16"><sup>16</sup></a>，
例如有光合速率，有叶片面积的数据，这样能够消除不同单位的影响，通常的缩放例如对数化。</p>
<div class="figure"><span style="display:block;" id="fig:pc2"></span>
<img src="images/pc2.png" alt="PC1 的诞生" width="100%" />
<p class="caption">
图 12.2: PC1 的诞生
</p>
</div>
<p>移动坐标系后，因为进行了缩放，所有的数据具有相同的比例。我们这时做一条最佳的拟合线(图 <a href="pca-anylysis.html#fig:pc2">12.2</a>)，此时发生了两件重要的事情：</p>
<ul>
<li>所有的点投影到这条拟合线上，投影后的点之间的距离是最大的，该方向代表了所有变异最大，也就是最大化的区分所有的数据点，因为我们的目的就是要区分数据点之间的差异。如果在读的各位有跟我一样空间想象力有限的，可以根据图 <a href="pca-anylysis.html#fig:maxvar">12.3</a> 的极端情况来理解，蓝色线为最佳拟合线，红色的数据点投影到其上的距离之和当然大于投影到蓝色的拟合线上。</li>
</ul>
<div class="figure"><span style="display:block;" id="fig:maxvar"></span>
<img src="bookdown_files/figure-html/maxvar-1.png" alt="变异最大的极端情况" width="672" />
<p class="caption">
图 12.3: 变异最大的极端情况
</p>
</div>
<ul>
<li>所有点和他们相对应的点之间的距离是最小的（也就是残差最小，最佳拟合当然是残差最小），这保证了这些投影的点和原来的数据点尽可能接近，也就是变化后损失的信息最少。</li>
</ul>
<p>以上变化的最终结果为将变异放到最大而误差降低到最小，我们研究的最终目的无非就是这样。这个最佳拟合的线我们将其称之为 PC1，主成份1。</p>
<div class="figure"><span style="display:block;" id="fig:pc3"></span>
<img src="images/pc3.png" alt="PC2 的诞生" width="100%" />
<p class="caption">
图 12.4: PC2 的诞生
</p>
</div>
<p>如果我们做一条通过中心点并与 PC1 垂直的线，并不断旋转这条线使其满足：所有投影于其上的点，他们的距离最大，也就是变异最大，这样就做出了第二个主成份，PC2，如图 <a href="pca-anylysis.html#fig:pc3">12.4</a>。<strong>就这样不断的变换，一般情况下，我们可以使用 2~3 个主成份来解释绝大部分数据所展示的信息（所有数据都尽可能少的损失信息投影于其上）</strong>。</p>
<p>以上为基本变换，如果我们使用 R 计算 PCA (这里推荐两个包 <code>factoextra</code> 和 <code>FactoMineR</code>)，查看其结果：</p>
<div class="sourceCode" id="cb276"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb276-1"><a href="pca-anylysis.html#cb276-1" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">&quot;FactoMineR&quot;</span>)</span>
<span id="cb276-2"><a href="pca-anylysis.html#cb276-2" aria-hidden="true" tabindex="-1"></a><span class="fu">library</span>(<span class="st">&quot;factoextra&quot;</span>)</span></code></pre></div>
<pre><code>## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa</code></pre>
<div class="sourceCode" id="cb278"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb278-1"><a href="pca-anylysis.html#cb278-1" aria-hidden="true" tabindex="-1"></a>ir <span class="ot">&lt;-</span> iris[, <span class="dv">1</span><span class="sc">:</span><span class="dv">4</span>]</span>
<span id="cb278-2"><a href="pca-anylysis.html#cb278-2" aria-hidden="true" tabindex="-1"></a>ir_pca <span class="ot">&lt;-</span> <span class="fu">PCA</span>(ir, <span class="at">graph =</span> <span class="cn">FALSE</span>)</span>
<span id="cb278-3"><a href="pca-anylysis.html#cb278-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb278-4"><a href="pca-anylysis.html#cb278-4" aria-hidden="true" tabindex="-1"></a><span class="fu">fviz_eig</span>(ir_pca, <span class="at">addlabels =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<div class="figure"><span style="display:block;" id="fig:scree"></span>
<img src="bookdown_files/figure-html/scree-1.png" alt="iris 碎石图" width="672" />
<p class="caption">
图 12.5: iris 碎石图
</p>
</div>
<p>我们可以看到，前两个成分可以解释数据 95% 以上的变异，所以我们可以只使用主成份 1 和主成份 2 对我们的结果进行解释。</p>
<p>既然我们使用两个主成份解释整个数据，那么我们怎么把四个性状都放在这个图上呢？这就需要载荷图来展示了，如图 <a href="pca-anylysis.html#fig:loadingpca">12.6</a></p>
<div class="sourceCode" id="cb279"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb279-1"><a href="pca-anylysis.html#cb279-1" aria-hidden="true" tabindex="-1"></a><span class="fu">fviz_pca_var</span>(ir_pca)</span></code></pre></div>
<div class="figure"><span style="display:block;" id="fig:loadingpca"></span>
<img src="bookdown_files/figure-html/loadingpca-1.png" alt="iris 载荷图" width="672" />
<p class="caption">
图 12.6: iris 载荷图
</p>
</div>
<p>怎么解释呢，因为原始的数据点相当于在坐标轴上，这几个性状分布的产生类似于原始的数据点在拉拽某个性状，影响强的偏向某一方向，换句话说，<strong>这些性状决定主成份时有不同的权重，也就是对主成份影响的权重大小。同时他们是有方向的，如果两个性状方向接近，也就是夹角非常小，说明他们有较强的正相关性，例如图中的花瓣的长宽，如果他们互相垂直，那说明他们无相关性，例如图中花萼的长宽，如果夹角非常大，例如他们几乎在一条直线上，说明具有显著的负相关</strong>。其本质还是所有的单位向量（本例有四个性状，各个性状中心化后形成的轴，也就是向量）在现在的这个二维平面的位置。</p>
<p>而如果我想通过这些性状来对鸢尾分类，怎么看呢？那就需要得分图来展示了，如图 <a href="pca-anylysis.html#fig:scorepca">12.7</a> ，得分图本质是各个品种的每个观测值在各个轴上的长度，也就是得分，所以其值都是每个物种性状的加权，每个点代表了每个物种的观测值。</p>
<div class="sourceCode" id="cb280"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb280-1"><a href="pca-anylysis.html#cb280-1" aria-hidden="true" tabindex="-1"></a><span class="fu">fviz_pca_ind</span>(ir_pca, <span class="at">repel =</span> <span class="cn">TRUE</span>, <span class="at">col.ind=</span> iris<span class="sc">$</span>Species)</span></code></pre></div>
<pre><code>## Warning: ggrepel: 69 unlabeled data points (too many overlaps). Consider
## increasing max.overlaps</code></pre>
<div class="figure"><span style="display:block;" id="fig:scorepca"></span>
<img src="bookdown_files/figure-html/scorepca-1.png" alt="iris 得分图" width="672" />
<p class="caption">
图 12.7: iris 得分图
</p>
</div>
<p>我们明显看出来，PC1 方向，三个种的鸢尾分成了两大部分，其中 Setosa 延 PC1 同其他两个明显有区别，另外两个在 PC1 上也有较明显的区别，但二者有一定的重合，延 PC2 方向上，三者差别不大。或者反过来讲也可以，品种的差别对 PC1 影响比较显著，这也和我们的碎石图相匹配。</p>
</div>
<div id="alge-pca" class="section level2" number="12.2">
<h2><span class="header-section-number">12.2</span> 线性代数解释</h2>
<div id="egi-pca" class="section level3" number="12.2.1">
<h3><span class="header-section-number">12.2.1</span> 特征向量与特征值</h3>
<p>特征向量和特征值的数学描述为：</p>
<p><span class="math display" id="eq:eign">\[\begin{equation}
A \vec{x} = \lambda \vec{x}
\tag{12.1}
\end{equation}\]</span></p>
<p>其中 A 为 n <span class="math inline">\(\times\)</span> n 的矩阵，<span class="math inline">\(\vec{x}\)</span> 为 非零 n <span class="math inline">\(\times\)</span> 1 列向量，<span class="math inline">\(\lambda\)</span> 是标量，那么 <span class="math inline">\(\vec{x}\)</span> 为 A 的特征向量，<span class="math inline">\(\lambda\)</span> 为 A 的特征值。</p>
<p>如果仅从数学描述上看，是十分不适合我这样没基础的人来理解的，但我们可以这么理解：</p>
<p>A 为我们观测值（也即我们生态学上测量的数据）组成的 <span class="math inline">\(n \times n\)</span> 矩阵，每行的数据代表了一个观测值，例如光合速率是其中的一行，我们有n 个， 那么 <span class="math inline">\(\vec{x}\)</span> 和 <span class="math inline">\(\lambda\)</span> 意味着什么呢？再看一眼上面的 <a href="pca-anylysis.html#eq:eign">(12.1)</a>，这是一个等式，而 <span class="math inline">\(\vec{x}\)</span> 是 n <span class="math inline">\(\times\)</span> 1 维度，原来的数据是 n <span class="math inline">\(\times\)</span> n 维度，这就是主轴分析是降维分析的意义了，一个一维的特征向量和特征值与我们多维的观测值之间有一个相等的关系。当然，也有很多人在描述时喜欢用坐标轴旋转或这投影来形容的，如果你觉得这样好理解也没问题，不过我脑袋不擅长想象这种多维的空间。这样描述并不十分准确，只是我觉得便于理解，更正确描述应为我们下面所述的例子 (<span class="citation">Smith (<a href="#ref-Smith2002" role="doc-biblioref">2002</a>)</span>) ，但降维的原理即来自此处：</p>
<p><span class="math display" id="eq:despca">\[\begin{equation}
finaldata = rowfeaturevector \times rowdataajust
\tag{12.2}
\end{equation}\]</span></p>
<p>finaldata 很好理解，我们用于 PCA 的最终数据，rowfeature vector 则是我们根据协相关矩阵求得的特征向量的转置，最大的特征向量再最上面， rowdataadjust 则为<strong>原始数据减去标准值</strong>。</p>
<p>因为我手头没有相关的数据，想来想去，我们在 R 里见到最多的与生态学相关的数据也就是 iris，一个关于不同 iris 品种的叶片性状相关的数据，非常生态，我们还是继续使用：</p>
<table>
<thead>
<tr class="header">
<th align="right">Sepal.Length</th>
<th align="right">Sepal.Width</th>
<th align="right">Petal.Length</th>
<th align="right">Petal.Width</th>
<th align="left">Species</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="right">5.1</td>
<td align="right">3.5</td>
<td align="right">1.4</td>
<td align="right">0.2</td>
<td align="left">setosa</td>
</tr>
<tr class="even">
<td align="right">4.9</td>
<td align="right">3.0</td>
<td align="right">1.4</td>
<td align="right">0.2</td>
<td align="left">setosa</td>
</tr>
<tr class="odd">
<td align="right">4.7</td>
<td align="right">3.2</td>
<td align="right">1.3</td>
<td align="right">0.2</td>
<td align="left">setosa</td>
</tr>
<tr class="even">
<td align="right">4.6</td>
<td align="right">3.1</td>
<td align="right">1.5</td>
<td align="right">0.2</td>
<td align="left">setosa</td>
</tr>
<tr class="odd">
<td align="right">5.0</td>
<td align="right">3.6</td>
<td align="right">1.4</td>
<td align="right">0.2</td>
<td align="left">setosa</td>
</tr>
<tr class="even">
<td align="right">5.4</td>
<td align="right">3.9</td>
<td align="right">1.7</td>
<td align="right">0.4</td>
<td align="left">setosa</td>
</tr>
</tbody>
</table>
<p>数据并不复杂，但是想要得出一些规律性的东西确不那么容易，因为数据量太大了。R 语言里面很多函数可以直接实现 PCA，例如 <a href="pca-anylysis.html#geom-pca">12.1</a> 内容。这里按照最原始的方法实现一下，加深对原理的理解：</p>
</div>
<div id="man_pca" class="section level3" number="12.2.2">
<h3><span class="header-section-number">12.2.2</span> 手动实现过程</h3>
<div id="av_val" class="section level4" number="12.2.2.1">
<h4><span class="header-section-number">12.2.2.1</span> 均值的计算</h4>
<div class="sourceCode" id="cb282"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb282-1"><a href="pca-anylysis.html#cb282-1" aria-hidden="true" tabindex="-1"></a>iris_mean <span class="ot">&lt;-</span> <span class="fu">apply</span>(iris[, <span class="dv">1</span><span class="sc">:</span><span class="dv">4</span>], <span class="dv">2</span>, <span class="cf">function</span>(x) x <span class="sc">-</span> <span class="fu">mean</span>(x))</span></code></pre></div>
<p>我只使用了前四列的性状数据，仅仅是方便结果的展示。</p>
</div>
<div id="cov_val" class="section level4" number="12.2.2.2">
<h4><span class="header-section-number">12.2.2.2</span> 计算协方差矩阵</h4>
<div class="sourceCode" id="cb283"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb283-1"><a href="pca-anylysis.html#cb283-1" aria-hidden="true" tabindex="-1"></a>iris_cov <span class="ot">&lt;-</span> <span class="fu">cov</span>(iris_mean)</span></code></pre></div>
</div>
<div id="eig_val" class="section level4" number="12.2.2.3">
<h4><span class="header-section-number">12.2.2.3</span> 计算特征值和特征向量</h4>
<div class="sourceCode" id="cb284"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb284-1"><a href="pca-anylysis.html#cb284-1" aria-hidden="true" tabindex="-1"></a>iris_eigen <span class="ot">&lt;-</span> <span class="fu">eigen</span>(iris_cov)</span></code></pre></div>
<p>这里就可以看到之前提到的，特征值和特征向量是根据协方差矩阵计算的。我们选取特征值最大的两个，他们的特征值之和已经占所有的特征值之和相当大的比例：</p>
<div class="sourceCode" id="cb285"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb285-1"><a href="pca-anylysis.html#cb285-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sum</span>(iris_eigen<span class="sc">$</span>values[<span class="dv">1</span><span class="sc">:</span><span class="dv">2</span>])<span class="sc">/</span><span class="fu">sum</span>(iris_eigen<span class="sc">$</span>values)</span></code></pre></div>
<pre><code>## [1] 0.9776852</code></pre>
<p>也就是说特征值对应的前两项是我们最终降维所需要的，即最终的两个主轴为 <span class="math inline">\(150 \times 2\)</span> 维矩阵，即我们原来的 <span class="math inline">\(150 \times 4\)</span> 的矩阵乘以我们选取的前两个特征值对应的 <span class="math inline">\(4 \times 2\)</span> 组成的矩阵。</p>
<p>实际应用中我们不需要这么做了，因为太浪费时间了，我们直接用函数来得到结果即可。</p>
</div>
</div>
<div id="prcom" class="section level3" number="12.2.3">
<h3><span class="header-section-number">12.2.3</span> <code>prcomp</code> 的实现</h3>
<p>我们用 <code>prcomp</code> 来简化实现过程，注意，根据 <span class="citation">Kemp (<a href="#ref-kemp2003modern" role="doc-biblioref">2003</a>)</span>，我们把 iris 数据对数化一下，并提取所有物种名字：</p>
<div class="sourceCode" id="cb287"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb287-1"><a href="pca-anylysis.html#cb287-1" aria-hidden="true" tabindex="-1"></a><span class="fu">data</span>(<span class="st">&quot;iris&quot;</span>)</span>
<span id="cb287-2"><a href="pca-anylysis.html#cb287-2" aria-hidden="true" tabindex="-1"></a>iris_pca <span class="ot">&lt;-</span> <span class="fu">log</span>(iris[, <span class="dv">1</span><span class="sc">:</span><span class="dv">4</span>])</span>
<span id="cb287-3"><a href="pca-anylysis.html#cb287-3" aria-hidden="true" tabindex="-1"></a>iris_species <span class="ot">&lt;-</span> iris<span class="sc">$</span>Species</span></code></pre></div>
<p>需要注意，我们处理时使用特征中心化。即每一维的数据都减去该维的均值。这里的“维”指的就是一个特征（或属性），变换之后每一维的均值都变成了0 (参考 <a href="pca-anylysis.html#eq:despca">(12.2)</a> )。</p>
<div class="sourceCode" id="cb288"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb288-1"><a href="pca-anylysis.html#cb288-1" aria-hidden="true" tabindex="-1"></a>value_pca <span class="ot">&lt;-</span> <span class="fu">prcomp</span>(iris_pca, <span class="at">center =</span> <span class="cn">TRUE</span>, <span class="at">scale. =</span> <span class="cn">TRUE</span>)</span>
<span id="cb288-2"><a href="pca-anylysis.html#cb288-2" aria-hidden="true" tabindex="-1"></a><span class="do">## 查看结果</span></span>
<span id="cb288-3"><a href="pca-anylysis.html#cb288-3" aria-hidden="true" tabindex="-1"></a><span class="fu">summary</span>(value_pca)</span></code></pre></div>
<pre><code>## Importance of components:
##                           PC1    PC2     PC3     PC4
## Standard deviation     1.7125 0.9524 0.36470 0.16568
## Proportion of Variance 0.7331 0.2268 0.03325 0.00686
## Cumulative Proportion  0.7331 0.9599 0.99314 1.00000</code></pre>
<p>可以看到结果同我们最开始的计算相似，不同的是我们进行了对数化，而且根据 <span class="citation">Kemp (<a href="#ref-kemp2003modern" role="doc-biblioref">2003</a>)</span>， 这个结果更合适。</p>
</div>
</div>
</div>
<h3>参考文献</h3>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-kemp2003modern" class="csl-entry">
Kemp, Freda. 2003. <span>“Modern Applied Statistics with s.”</span> <em>Journal of The Royal Statistical Society Series D-the Statistician</em> 52 (4): 704–5.
</div>
<div id="ref-Smith2002" class="csl-entry">
Smith, Lindsay I. 2002. <span>“A Tutorial on Principal Component Analysis.”</span>
</div>
</div>
            </section>

          </div>
        </div>
      </div>
<a href="big-leaf.html" class="navigation navigation-prev " aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<a href="sessioninfo.html" class="navigation navigation-next " aria-label="Next page"><i class="fa fa-angle-right"></i></a>
    </div>
  </div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/clipboard.min.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-clipboard.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": true,
"facebook": false,
"twitter": true,
"linkedin": false,
"weibo": false,
"instapaper": false,
"vk": false,
"whatsapp": false,
"all": ["facebook", "twitter", "linkedin", "weibo", "instapaper"]
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": "https://github.com/zhujiedong/photoanalysis/blob/master/13-2-pca.Rmd",
"text": "编辑"
},
"history": {
"link": null,
"text": null
},
"view": {
"link": null,
"text": null
},
"download": ["bookdown.pdf"],
"search": {
"engine": "fuse",
"options": null
},
"toc": {
"collapse": "section"
}
});
});
</script>

<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    var src = "true";
    if (src === "" || src === "true") src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML";
    if (location.protocol !== "file:")
      if (/^https?:/.test(src))
        src = src.replace(/^https?:/, '');
    script.src = src;
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>
</body>

</html>
